POV-Ray : Newsgroups : povray.general : Smooth blending question : Re: Smooth blending question Server Time
5 Aug 2024 10:25:35 EDT (-0400)
  Re: Smooth blending question  
From: How Camp
Date: 8 Oct 2002 16:55:51
Message: <3da34657@news.povray.org>
"Shay" <sah### [at] simcopartscom> wrote in message
news:3da31f83@news.povray.org...
>
> I think so. Let me verify. I am assuming that each of the thousands of
> points has a strength at it's point of impact and then has a sphere around
> it of decreasing strength. Is this correct? If so, here is your solution:

More or less.  Our xyz data set has no inherent strength information - only
varying densities of particles.  Here's a real example of some of our data:
We have a grid of values, 51x21.  Each gridpoint has a height associated
with it.  We simply want to plot each of these xyz points, and smoothly
connect them in some sort of surface.

So, applying your approach sounds very good - this was what I attempted to
do with blobs.  Each disc represents particle's xy position, while the color
(some shade of gray) would represent the color's height.  The highest z
value in our 51x21 grid would be given the color rgb <1,1,1> etc.  The trick
comes in properly blending these multi-shaded discs from one grid position
to another.  Here's my sad attempt at a graphical explanation (which will,
of course, show up as garbage in a non-fixed-width-font newsreader):

+-+-+-+
|0|0|0|
+-+-+-+
|1|0|2|
+-+-+-+
|3|2|3|
+-+-+-+
|5|1|1|
+-+-+-+


Hence, the lower left-hand corner presents a problem of blending from a high
peak (color value 5) to a low peak (color value 1) as we move horizontally.
If we put two discs of varying intensity, I don't believe the pigments will
properly blend.

>
> You do not need to mesh this data. A PoV-Ray isosurface will solve this
> problem easily. You could combine all of the points into one giant
equation,
> but that would be the slow, hard way, and I believe that PoV-Ray has a
limit
> to the number of terms in an equation anyway. So the solution is to make a
> disk with a pigment which is rgb 1 with a transmit value of 1/10K in the
> center and blends towards completely transparent at the edges. The pigment
> blend can be linear or based off of any equation you may have for the
> falloff of the strength of each point. Just place one of these disks at
each
> point where you placed your spheres and place a black plane beneath the
set
> of disks. Make an orthographic rendering of this set and use it as a
> displacement map of the isosurface. Apply a gradient pigment if you like
and
> you are done.

Okay, I tried this to see if it would help, and I've discovered some strange
things about pigments.  My scene file is shown below (sorry - I should
probably put it in p.b.s-f but it's short).  The problem seems to be the
lack of transparency from one disc to another.  What am I doing wrong?

- How


camera {
  orthographic
  location  <0.0, 0.0, -10.0>
  look_at   <0.0, 0.0,  0.0>
}

background {  Black  }

light_source {  <-30, 30, -30>  color White  }

// ----------------------------------------

#declare TexOn=true ;


#if (TexOn)
        #declare DTex = texture {
                pigment {
                        spherical
                        color_map {
                                [ 0.0 rgbft <1.0, 1.0, 1.0, 1.0, 1.0> ]
                                [ 1.0 rgbft <1.0, 1.0, 1.0, 0.0, 0.0> ]
                        }
                scale 2
                }
        }
#else
        #declare DTex = texture { pigment {color Green} }
#end

#declare DiscRad = 1;

disc { 0 z, DiscRad, 0 texture {DTex} translate <0,0,0.0000>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <1,0,0.0001>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <0,1,0.0002>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <0,2,0.0003>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <3,2,0.0004>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <5,1,0.0005>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <1,6,0.0006>}
disc { 0 z, DiscRad, 0 texture {DTex} translate <2,4,0.0007>}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.